add_definitions("-Wall -g -std=c99")

find_package(PkgConfig REQUIRED)
pkg_check_modules (JSON_C REQUIRED json-c)
pkg_check_modules (CURL REQUIRED libcurl)

if (JSON_C_FOUND)
	set (EXTRA_LIBS ${EXTRA_LIBS} ${JSON_C_LIBRARIES})
	set (INCLUDE_DIRS ${INCLUDE_DIRS} ${JSON_C_INCLUDE_DIRS})
endif(JSON_C_FOUND)

if (CURL_FOUND)
	set (EXTRA_LIBS ${EXTRA_LIBS} ${CURL_LIBRARIES})
	set (INCLUDE_DIRS ${INCLUDE_DIRS} "${CURL_INCLUDE_DIRS}/curl")
endif(CURL_FOUND)

add_executable(${appname} wordpress-json-app.c)
target_link_libraries(${appname} ${EXTRA_LIBS})
include_directories(${INCLUDE_DIRS})
#message ("${EXTRA_LIBS}")
